package com.ice.ubt.greendao;

import android.database.Cursor;


import java.util.ArrayList;
import java.util.List;

/**
 */

public class DbUtil {
    private static DbUtil instance;

    private DbUtil() {
        initDataBase();
    }

    public static DbUtil getInstance() {
        if (instance == null) {
            instance = new DbUtil();
        }
        return instance;
    }

    private void initDataBase() {

    }





    public static List<String> querySql(String query) {
        ArrayList<String> result = new ArrayList<String>();
        Cursor c = DbCore.getDaoSession().getDatabase().rawQuery(query, null);
        try{
            if (c.moveToFirst()) {
                do {
                    result.add(c.getString(0));
                } while (c.moveToNext());
            }
        } finally {
            c.close();
        }
        return result;
    }
}
